<%-- 
    Document   : CheckLogin
    Created on : Jan 23, 2013, 3:28:14 PM
    Author     : TuanAnh
--%>

<%@page import="edu.fpt.stub.LoginStub"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <%
            try {
                String id = request.getParameter("login");
                String pass = request.getParameter("password");
                LoginStub stub = new LoginStub();
                if (stub.checkLogin(id, pass)) {
                    session = request.getSession();
                    session.setAttribute("id", id);
                    response.sendRedirect("AdminForm.jsp");
                } else {
                    response.sendRedirect("LoginForm.jsp");
                }
            } catch (Exception ex) {
            }
        %>
    </body>
</html>
